package com.zzj.controller;

import com.zzj.bean.ProvinceBean;
import com.zzj.service.ProvinceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


@Api
@CrossOrigin
@RestController
@RequestMapping("province")
public class ProvinceController {
    @Resource
    private ProvinceService provinceService;

    /**获取所有的省份
     * @return
     */
    @GetMapping("allProvince")
    @ApiOperation("获得所有省份")
    public List<ProvinceBean> allProvince(){
        return provinceService.list();
    }

}
